package Org.csmzxy.class2333;

public class Example25 {
    //定义整数相除的方法
    public static int divide(int num1,int num2) throws Exception{
        return num1 / num2;
    }
    public static void main(String[] args) {
       int num1 = 10;
       int num2 = 0;
       int result = 0;
       try {
        result = divide(num1,num2);
    }catch (Exception){
        throw new RuntimeException("除数不能为0");
    }
    System.out.println("10除以0的结果为"+ result);
    }
}
